﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity.Framework;

using System.Data.Objects;

namespace Business.Operations
{
    public class StatSehirOperation
    {
        private static HPDMASEntities db = new HPDMASEntities();

        public StatSehirOperation()
        {

        }

        public static List<StatSehir> StatSehirGetAll()
        {
            var statSehirListesi = db.StatSehir.ToList();
            return statSehirListesi;
        }

        public static StatSehir StatSehirGetByStatSehirId(int statSehirId)
        {
            var statSehir = (from c in db.StatSehir where c.StatSehirID == statSehirId select c).First();
            return statSehir;
        }

        public static void StatSehirDelete(int statSehirId)
        {
            StatSehir k = (from c in db.StatSehir where c.StatSehirID == statSehirId select c).First();
            db.DeleteObject(k);
            db.SaveChanges();
        }

        public static void StatSehirInsert(StatSehir statSehir)
        {
            db.StatSehir.AddObject(statSehir);
            db.SaveChanges();
        }
    }
}
